package com.tcc.qa.test.util;

import org.apache.xpath.operations.String;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;

public class CheckBoxFinder {
  public static WebElement getCheckBox(WebDriver driver, String name, int index) {
    return driver.findElements(By.xpath("//input[(@type='checkbox' or @type='CHECKBOX') and @name='" + name + "']")).get(index);

  }
  public static WebElement getCheckBoxCheckAll(WebDriver driver) {
	return driver.findElement(By.xpath("//input[(@type='checkbox' or @type='CHECKBOX') and @onclick='checkPageAll()']"));
  }
  public static WebElement getCheckBoxById(WebDriver driver, String name){
    return driver.findElement(By.id(name));
  }
  public static WebElement getCheckBoxByValue(WebDriver driver, String value){
	    return driver.findElement(By.xpath("//input[(@type='checkbox' or @type='CHECKBOX') and @value='" + value + "']"));
	  } 
  public static WebElement getCheckBoxByTitle(WebDriver driver, String title){
		    return driver.findElement(By.xpath("//input[(@type='checkbox' or @type='CHECKBOX') and @title='" + title + "']"));
	  }
}
